<template>
  <div>
    <!-- <el-tabs
      v-model="activeName"
      @tab-click="handleChangetab"
      class="text-tabs TTB-gutter"
    >
      <el-tab-pane
        v-for="(item, index) in dict.type.device_functional_type"
        :key="index"
        :label="item.label"
        :name="item.value"
      ></el-tab-pane>
    </el-tabs> -->

    <!-- <Title name="智能设备档案" :line="false">
      <stat-painting :data="stat" class="bg">

        <div class="btns">
          <remote-select
            v-model="monitoringNetworkId"
            varient="networks"
            :props="{
              label: 'name',
              value: 'id',
            }"
            :extraParams="{ sysDeptId: sysDeptId }"
            placeholder="请选择能耗终端"
            clearable
            @input="change"
            style="margin-right: 20px"
          ></remote-select>
          <el-button
            v-hasPermi="['device:archive:add']"
            type="text"
            @click="showModel('operate', '')"
            >新增</el-button
          >
          <el-button
            v-hasPermi="['device:archive:import']"
            type="text"
            @click="showModel('exports', '')"
            >批量导入</el-button
          >
        </div>
      </stat-painting>
    </Title> -->

    <lb-layout
      v-loading="$store.getters.loading"
      element-loading-text="拼命加载中"
      element-loading-spinner="el-icon-loading"
      element-loading-background="#a19f9fb0;"
      :paddBottom="5"
    >
      <div class="flex-row">
        <z-tree
          v-model="sysDeptList"
          varient="energy"
          node-key="id"
          @handleNodeClick="handleNodeClick"
          class="bg left"
        ></z-tree>

        <div class="bg right">
          <aps-form
            :config="apsForm.formConfig"
            :model="apsForm.formData"
            :formRef="apsForm.formRef"
            :labelWidth="apsForm.labelWidth"
            ref="form"
          ></aps-form>
          <lb-table
            :column="tableData.column"
            :data="tableData.data"
            pagination
            background
            border
            height="610"
            layout="total, sizes, prev, pager, next, jumper"
            :page-sizes="[20, 40, 60, 80]"
            :pager-count="5"
            :current-page.sync="currentPage"
            :total="total"
            :page-size="pageSize"
            @size-change="handleSizeChange"
            @p-current-change="handleCurrentChange"
          >
          </lb-table>
        </div>
      </div>
    </lb-layout>

    <component
      :is="modelName"
      :id="id"
      :type="type"
      :visible.sync="show"
      @close="close"
    ></component>
  </div>
</template>

<script>
import { dealElectricity } from "@/utils/index";
import { list, total, edit, del } from "@/api/iot/archives";
import vueQr from "vue-qr";
import Title from "@/components/Title";
import detail from "@/views/resource/device/archives/components/detail.vue";
import exports from "@/views/resource/device/archives/components/exports.vue";
import operate from "@/views/resource/device/archives/components/operate.vue";
import zTree from "@/components/zTree";
import RemoteSelect from "@/components/Select/RemoteSelect";
import DictionariesSelect from "@/components/DictionariesSelect/index.vue";
import auth from "@/plugins/auth";

export default {
  dicts: [
    "device_type",
    "device_model",
    "device_functional_type",
    "device_sub_functional_type",
    "wmeter_device_model",
    "device_alarm_type",
    "manufacturer",
  ],
  name: "archives",
  components: {
    vueQr,
    Title,
    detail,
    exports,
    operate,
    zTree,
    RemoteSelect,
  },
  data() {
    return {
      activeName: "0",
      type: 0,
      stat: [
        {
          name: "智能电表",
          num: 0,
          img: require("@/assets/images/iot/zhinengdianbiao.png"),
          imgBgColor: "#a84a4a",
          bgColor: "#d88989",
        },
        {
          name: "光伏板",
          num: 77,
          img: require("@/assets/images/iot/guangfuban.png"),
          imgBgColor: "#3080e7",
          bgColor: "#5b9cec",
        },
        {
          name: "充电桩",
          num: 39,
          img: require("@/assets/images/iot/chongdianzhuang.png"),
          imgBgColor: "#77a72e",
          bgColor: "#90b35b",
        },
      ],
      monitoringNetworkId: "",
      show: false,
      modelName: "",
      id: "",
      sysDeptList: [],
      sysDeptId: null,
      apsForm: {
        formRef: "form",
        labelWidth: "120px",
        formData: {},
        formConfig: {
          formAttr: {
            inline: true,
            size: "small",
          },
          properties: {
            //这里是渲染查询表单的表头和类型的数据
            functionalType: {},
            subFunctionalType: {
              render: (h) => {
                let that = this;
                if (that.activeName == 0) {
                  return (
                    <div>
                      {
                        <DictionariesSelect
                          showType={1}
                          valueType={1}
                          datas={0}
                          needDefault={false}
                          selectArr={that.dict.type.device_sub_functional_type}
                          onHandleSelect={(val) => {
                            that.$refs?.form?.setFieldValue(
                              "subFunctionalType",
                              val
                            );
                            this.$refs?.form?.setFieldValue(
                              "functionalType",
                              0
                            );
                            this.$refs?.form?.setFieldValue("alarmType", "");
                            this.$refs?.form?.setFieldValue("model", "");
                            that.type = val;
                            that.changeTablecolumn();
                            that.$forceUpdate();
                          }}
                        ></DictionariesSelect>
                      }
                    </div>
                  );
                }
              },
            },
            networks: {
              typeName: "el-select",
              render: () => {
                let that = this;
                return (
                  <div>
                    <RemoteSelect
                      v-model={that.monitoringNetworkId}
                      varient="networks"
                      extraParams={{ sysDeptId: that.sysDeptId }}
                      // propss="{ label: name, value: id }"
                      size={"small"}
                      placeholder={"请选择能耗终端"}
                      onInput={that.monitoringchange}
                    ></RemoteSelect>
                  </div>
                );
              },
            },
            cardNum: {
              typeName: "el-input",
              placeholder: "物联网卡号",
            },
            alarmType: {
              typeName: "el-select",
              render: (h) => {
                let that = this;
                const subFunctionalType =
                  that.$refs?.form?.getFieldsValue().subFunctionalType;
                let arr = [];
                that.dict?.type?.device_alarm_type.some((item) => {
                  if (subFunctionalType == 0) {
                    if (Number(item.value) < 100) {
                      arr.push(item);
                    }
                  } else {
                    if (Number(item.value) >= 100) {
                      arr.push(item);
                    }
                  }
                });
                // 数据严谨处理,处理后端数据异常情况
                let valNum = that.$refs?.form?.getFieldsValue().alarmType;

                let a = [
                  h(
                    "el-select",
                    {
                      attrs: {
                        placeholder: "预警状态",
                        value: valNum,
                      },
                      props: ["value"],
                      on: {
                        change: (value) => {
                          that.$refs?.form?.setFieldValue("alarmType", value);
                          that.$forceUpdate();
                        },
                      },
                    },
                    [
                      arr.map((item) => {
                        let { label, value } = item;
                        return h("el-option", {
                          props: {
                            label,
                            value,
                            key: value,
                          },
                        });
                      }),
                    ]
                  ),
                ];
                return h("div", a);
              },
            },
            status: {
              typeName: "el-select",
              render: (h) => {
                let that = this;
                let arr = [
                  {
                    value: 2,
                    label: "故障",
                  },
                  {
                    value: 1,
                    label: "启用",
                  },
                ];

                // 数据严谨处理,处理后端数据异常情况
                let valNum = that.$refs?.form?.getFieldsValue().status;

                let a = [
                  h(
                    "el-select",
                    {
                      attrs: {
                        placeholder: "设备状态",
                        value: valNum,
                      },
                      props: ["value"],
                      on: {
                        change: (value) => {
                          that.$refs?.form?.setFieldValue("status", value);
                          that.$forceUpdate();
                        },
                      },
                    },
                    [
                      arr.map((item) => {
                        let { label, value } = item;
                        return h("el-option", {
                          props: {
                            label,
                            value: parseInt(value),
                            key: value,
                          },
                        });
                      }),
                    ]
                  ),
                ];
                return h("div", a);
              },
            },
            manufacturer: {
              typeName: "el-select",
              render: (h) => {
                let that = this;
                let arr = [];
                that.dict?.type?.manufacturer.some((item) => {
                  arr.push(item);
                });
                // 数据严谨处理,处理后端数据异常情况
                let valNum = that.$refs?.form?.getFieldsValue().manufacturer;

                let a = [
                  h(
                    "el-select",
                    {
                      attrs: {
                        placeholder: "设备厂商",
                        value: valNum,
                      },
                      props: ["value"],
                      on: {
                        change: (value) => {
                          that.$refs?.form?.setFieldValue(
                            "manufacturer",
                            value
                          );
                          that.$forceUpdate();
                        },
                      },
                    },
                    [
                      arr.map((item) => {
                        let { label, value } = item;
                        return h("el-option", {
                          props: {
                            label,
                            value: label,
                            key: value,
                          },
                        });
                      }),
                    ]
                  ),
                ];
                return h("div", a);
              },
            },
            model: {
              typeName: "el-select",
              render: (h) => {
                let that = this;
                let arr = [];
                if (
                  that.$refs?.form?.getFieldsValue().subFunctionalType === 0
                ) {
                  that.dict?.type?.device_model.some((item) => {
                    arr.push(item);
                  });
                } else if (
                  that.$refs?.form?.getFieldsValue().subFunctionalType === 1
                ) {
                  that.dict?.type?.wmeter_device_model.some((item) => {
                    arr.push(item);
                  });
                }
                // 数据严谨处理,处理后端数据异常情况
                let valNum = that.$refs?.form?.getFieldsValue().model;

                let a = [
                  h(
                    "el-select",
                    {
                      attrs: {
                        placeholder: "设备型号",
                        value: valNum,
                      },
                      props: ["value"],
                      on: {
                        change: (value) => {
                          that.$refs?.form?.setFieldValue("model", value);
                          that.$forceUpdate();
                        },
                      },
                    },
                    [
                      arr.map((item) => {
                        let { label, value } = item;
                        return h("el-option", {
                          props: {
                            label,
                            value: parseInt(value),
                            key: value,
                          },
                        });
                      }),
                    ]
                  ),
                ];
                return h("div", a);
              },
            },
            code: {
              typeName: "el-input",
              placeholder: "设备编号",
            },
          },
          formSoltButton: [
            {
              label: "搜索",
              type: "primary",
              typeName: "el-button",
              size: "small",
              icon: "el-icon-search",
              click: this.handlerSearchDetail,
            },
            {
              label: "重置",
              typeName: "el-button",
              size: "small",
              icon: "el-icon-refresh-left",
              click: this.handleReset,
            },
            {
              label: "新增",
              type: "primary",
              typeName: "el-button",
              size: "small",
              icon: "el-icon-plus",
              display: true,
              click: () => this.showModel("operate", ""),
            },
            {
              label: "导入",
              type: "success",
              typeName: "el-button",
              size: "small",
              icon: "el-icon-upload2",
              click: () => this.showModel("exports", ""),
            },
            // {
            //   label: "3D位置管理",
            //   type: "primary",
            //   typeName: "el-button",
            //   size: "small",
            //   icon: "el-icon-right",
            //   click: this.handlerGo3D,
            // },
          ],
        },
      },
      tableData: {
        column: [],
        data: [],
      },
      operationColumn: [
        {
          label: "操作",
          width: "300",
          fixed: "right",
          render: (h, scope) => {
            let that = this;
            return (
              <div>
                {
                  <el-button
                    v-hasPermi={["device:archive:edit"]}
                    type="text"
                    size="small"
                    icon="el-icon-edit"
                    onClick={() => {
                      this.showModel("operate", scope.row);
                    }}
                  >
                    修改
                  </el-button>
                }
                {
                  <el-button
                    v-hasPermi={["device:archive:detail"]}
                    type="text"
                    size="small"
                    icon="el-icon-view"
                    onClick={() => {
                      this.showModel("detail", scope.row);
                    }}
                  >
                    详情
                  </el-button>
                }
                {
                  <el-button
                    v-hasPermi={["device:archive:back"]}
                    type="text"
                    size="small"
                    icon="el-icon-folder-delete"
                    onClick={() => {
                      this.handleBack(scope.row);
                    }}
                  >
                    {scope.row.status === 3 ? "取消返厂" : "返厂"}
                  </el-button>
                }
                {
                  <el-button
                    v-hasPermi={["device:archive:remove"]}
                    type="text"
                    size="small"
                    icon="el-icon-delete"
                    onClick={() => {
                      this.handleOperDelete(scope.row);
                    }}
                    style="color:red"
                  >
                    删除
                  </el-button>
                }
              </div>
            );
          },
        },
      ],
      currentPage: 1,
      pageSize: 20,
      total: 0,
      multipleSelection: [],
    };
  },
  created() {
    this.routerJudge();
  },
  mounted() {
    if (this.$route?.query?.id) {
      this.monitoringNetworkId = Number(this.$route.query.id);
    }
    this.$refs?.form?.setFieldValue("subFunctionalType", 0);
    this.judgePermi();
    this.changeTablecolumn();
  },
  methods: {
    routerJudge() {
      // 对应的 activeName 是由device_functional_type字典决定的，因此改字典不可轻易动
      let routeflage = this.$route.path;
      // console.log(routeflage, "routeflage");
      switch (routeflage) {
        case "/resource/device/archives":
          this.activeName = "0";
          break;
        case "/resource/device/fixation":
          this.activeName = "1";
          break;
        case "/resource/device/firecontrol":
          this.activeName = "2";
          break;
      }
      this.$refs?.form?.setFieldValue("functionalType", this.activeName);
    },
    handlerGo3D() {
      this.$router.push({ path: "/basicdata/location" });
    },
    handleChangetab(tab) {
      let val = tab.name;
      this.$refs?.form?.setFieldValue("functionalType", val);
      this.changeTablecolumn();
    },
    changeTablecolumn() {
      let flag = this.$refs.form.getFieldsValue().subFunctionalType;
      let tablecc = [];
      this.tableData.data = [];
      if (flag == 0) {
        // 计量电表
        tablecc = [
          {
            prop: "code",
            label: "设备编码",
            width: 150,
            showOverflowTooltip: true,
          },
          {
            prop: "name",
            label: "设备名称",
            minWidth: 150,
            showOverflowTooltip: true,
          },
          {
            prop: "type",
            label: "设备类型",
            width: 130,
            align: "center",
            showOverflowTooltip: true,
            render: (h, scope) => {
              return (
                <div>
                  <dict-tag
                    options={this.dict.type.device_type}
                    value={scope.row.type}
                  />
                </div>
              );
            },
          },
          {
            prop: "model",
            label: "设备型号",
            width: 130,
            align: "center",
            showOverflowTooltip: true,
            render: (h, scope) => {
              return (
                <div>
                  <dict-tag
                    options={this.dict.type.device_model}
                    value={scope.row.model}
                  />
                </div>
              );
            },
          },
          {
            prop: "qrCode",
            width: "100",
            label: "二维码",
            align: "center",
            render: (h, scope) => {
              if (scope.row.qrCode) {
                return (
                  <div>
                    <vueQr
                      // logoSrc={scope.row.qrCode}
                      text={scope.row.qrCode}
                      size={40}
                      margin={0}
                    ></vueQr>
                  </div>
                );
              }
            },
          },
          {
            prop: "functionalType",
            label: "职能分类",
            width: 130,
            align: "center",
            showOverflowTooltip: true,
            render: (h, scope) => {
              return (
                <div>
                  <dict-tag
                    options={this.dict.type.device_functional_type}
                    value={scope.row.functionalType}
                  />
                </div>
              );
            },
          },
          {
            prop: "cardNum",
            width: "150",
            label: "物联网卡号",
            showOverflowTooltip: true,
          },
          {
            prop: "totalPower",
            width: "150",
            label: "累计电耗（度）",
            render: (h, params) => {
              let num = dealElectricity(params.row.totalPower);
              return h("div", {}, num);
            },
          },
          {
            prop: "ratedPower",
            width: "150",
            label: "额定功率（W）",
            render: (h, params) => {
              let num = dealElectricity(params.row.ratedPower, 1, 0);
              return h("div", {}, num);
            },
          },
          {
            prop: "thisYearUsedHours",
            width: "150",
            label: "使用时长（h/a）",
          },
          {
            prop: "ratedCurrent",
            width: "150",
            label: "额定电流（A）",
            render: (h, params) => {
              let num = dealElectricity(params.row.ratedCurrent);
              return h("div", {}, num);
            },
          },
          {
            prop: "alarmType",
            label: "预警状态",
            width: 150,
            align: "center",
            showOverflowTooltip: true,
            render: (h, scope) => {
              return (
                <div>
                  <dict-tag
                    options={this.dict.type.device_alarm_type}
                    value={scope.row.alarmType}
                  />
                </div>
              );
            },
          },
          {
            prop: "warningTime",
            width: "80",
            label: "告警次数",
          },
          {
            prop: "checkTimeLatest",
            width: "150",
            label: "最新巡检时间",
          },
          {
            prop: "statusName",
            width: "100",
            label: "设备状态",
          },
        ];
        this.tableData.column = [...tablecc, ...this.operationColumn];
      } else if (flag == 1) {
        // 计量水表
        tablecc = [
          {
            prop: "code",
            label: "设备编码",
            width: 150,
            showOverflowTooltip: true,
          },
          {
            prop: "name",
            label: "设备名称",
            minWidth: 150,
            showOverflowTooltip: true,
          },
          {
            prop: "type",
            label: "设备类型",
            width: 120,
            align: "center",
            showOverflowTooltip: true,
            render: (h, scope) => {
              return (
                <div>
                  <dict-tag
                    options={this.dict.type.device_type}
                    value={scope.row.type}
                  />
                </div>
              );
            },
          },
          {
            prop: "model",
            label: "设备型号",
            width: 120,
            align: "center",
            showOverflowTooltip: true,
            render: (h, scope) => {
              return (
                <div>
                  <dict-tag
                    options={this.dict.type.wmeter_device_model}
                    value={scope.row.model}
                  />
                </div>
              );
            },
          },
          {
            prop: "qrCode",
            width: "100",
            label: "二维码",
            align: "center",
            render: (h, scope) => {
              if (scope.row.qrCode) {
                return (
                  <div>
                    <vueQr
                      // logoSrc={scope.row.qrCode}
                      text={scope.row.qrCode}
                      size={40}
                      margin={0}
                    ></vueQr>
                  </div>
                );
              }
            },
          },
          {
            prop: "functionalType",
            label: "职能分类",
            width: 120,
            align: "center",
            showOverflowTooltip: true,
            render: (h, scope) => {
              return (
                <div>
                  <dict-tag
                    options={this.dict.type.device_functional_type}
                    value={scope.row.functionalType}
                  />
                </div>
              );
            },
          },
          // {
          //   prop: "deviceWaterEmeterVo.",
          //   label: "电压范围",
          // },
          // {
          //   prop: "deviceWaterEmeterVo.",
          //   width: "120",
          //   label: "工作温度范围",
          // },
          {
            prop: "cardNum",
            width: "150",
            label: "物联网卡号",
            showOverflowTooltip: true,
          },
          {
            prop: "ratedCurrent",
            width: "150",
            label: "启动电流（A）",
            render: (h, params) => {
              let num = dealElectricity(params.row.ratedCurrent);
              return h("div", {}, num);
            },
          },
          {
            prop: "alarmType",
            label: "预警状态",
            width: 150,
            align: "center",
            showOverflowTooltip: true,
            render: (h, scope) => {
              return (
                <div>
                  <dict-tag
                    options={this.dict.type.device_alarm_type}
                    value={scope.row.alarmType}
                  />
                </div>
              );
            },
          },
          {
            prop: "warningTime",
            width: "80",
            label: "告警次数",
          },
          {
            prop: "checkTimeLatest",
            width: "150",
            label: "最新巡检时间",
          },
          {
            prop: "statusName",
            width: "100",
            label: "设备状态",
          },
        ];
        this.tableData.column = [...tablecc, ...this.operationColumn];
      }
      setTimeout(() => {
        this.handlerSearchDetail();
      }, 100);
    },
    judgePermi() {
      if (auth.hasPermi("device:archive:add")) {
        this.apsForm.formConfig.formSoltButton[2].display = false;
      }
      if (auth.hasPermi("device:archive:import")) {
        this.apsForm.formConfig.formSoltButton[3].display = false;
      }
    },
    async initData(currentPage, pageSize, data) {
      let that = this;
      let query = {
        ...data,
      };
      if (currentPage) {
        query.pageNum = currentPage;
      } else {
        query.pageNum = that.currentPage;
      }
      if (pageSize) {
        query.pageSize = pageSize;
      } else {
        query.pageSize = that.pageSize;
      }
      that.$store.commit("app/updateApiCount", "add");
      await list(query)
        .then((res) => {
          that.$store.commit("app/updateApiCount");
          if (res.code === 700) {
            that.$message.warning(res.msg);
            return false;
          }
          that.tableData.data = res.rows;
          that.total = res.total;
        })
        .catch(() => {
          that.$store.commit("app/updateApiCount");
          // this.$message.error("系统错误,请联系管理员!300021");
        });
      // await total(query)
      //   .then((res) => {
      //     if (res.code === 700) {
      //       that.$message.warning(res.msg);
      //       return false;
      //     }
      //     that.stat = that.stat.map((item) => {
      //       if (item.name === "智能电表") {
      //         item.num = res?.data?.meterNum;
      //       }
      //       return item;
      //     });
      //   })
      //   .catch(() => {
      //     // this.$message.error("系统错误,请联系管理员!300026");
      //   });
    },
    /* 搜索 */
    handlerSearchDetail(val) {
      //val===1 删除操作成功后分页边界值处理
      let currentPage = 1;
      if (val === 1) {
        if (
          this.total === (this.currentPage - 1) * this.pageSize + 1 &&
          this.total !== 0 &&
          this.currentPage > 1
        ) {
          currentPage = this.currentPage - 1;
          this.currentPage = currentPage;
        } else {
          currentPage = this.currentPage;
        }
      } else {
        currentPage = this.currentPage;
      }
      const data = {
        ...this.$refs?.form?.getFieldsValue(),
        sysDeptId: this.sysDeptId,
        monitoringNetworkId: this.monitoringNetworkId,
        code: this.$refs?.form?.getFieldsValue().code,
        functionalType: this.$refs?.form?.getFieldsValue().functionalType,
        subFunctionalType:
          this.activeName == 0
            ? this.$refs?.form?.getFieldsValue().subFunctionalType
            : null,
      };
      this.initData(currentPage, this.pageSize, data);
    },
    //返厂
    handleBack(params) {
      const { id, type, code, status } = params;
      let text = status == 3 ? "取消返厂" : "返厂";
      this.$modal
        .confirm("请确认本设备编码" + code + "，是否要" + text + "？")
        .then(() => {
          edit({ id, type, status: status == 3 ? 0 : 3 })
            .then((res) => {
              this.loading = false;
              if (res.code === 700) {
                this.$message.warning(res.msg);
                return false;
              }
              this.$message.success("操作成功");
              this.handlerSearchDetail();
            })
            .catch(() => {
              this.loading = false;
              // this.$message.error("系统错误,请联系管理员!300024");
            });
        })
        .catch(() => {});
    },
    close(status) {
      this.show = false;
      setTimeout(() => {
        if (status) this.handlerSearchDetail();
      }, 200);
    },
    monitoringchange(val) {
      this.handlerSearchDetail();
    },
    // 节点单击事件
    handleNodeClick(data) {
      this.sysDeptId = data.id;
      this.handlerSearchDetail();
    },
    //删除
    handleOperDelete(row) {
      let that = this;
      const text = "是否确认删除" + (row?.name ?? "该条数据") + "？";
      that.$modal
        .confirm(text)
        .then(() => {
          del(row.id)
            .then((res) => {
              if (res.code === 700) {
                that.$message.warning(res.msg);
                return false;
              }
              that.$message.success("已删除!");
              that.initData();
            })
            .catch((err) => {
              // this.$message.error("系统错误,请联系管理员!30025");
            });
        })
        .catch(() => {});
    },
    handleSizeChange(val) {
      this.currentPage = 1;
      this.pageSize = val;
      this.handlerSearchDetail();
    },
    handleCurrentChange(val) {
      this.currentPage = val;
      this.handlerSearchDetail();
    },
    handleReset() {
      //重置
      this.sysDeptId = "";
      this.monitoringNetworkId = "";
      this.$refs?.form?.resetFields();
      this.$refs?.form?.setFieldValue("code", "");
      this.$refs?.form?.setFieldValue("functionalType", 0);

      this.$refs?.form?.setFieldValue("subFunctionalType", this.type);
      // this.$refs?.form?.resetFields();
      this.handlerSearchDetail();
    },
    // 弹窗
    showModel(name, params) {
      this.modelName = name;
      this.id = params.id || "";
      setTimeout(() => {
        this.show = true;
      }, 200);
    },
  },
};
</script>
<style scoped lang="scss">
@import "@/assets/styles/mixin.scss";

::v-deep .flex-row {
  display: flex;

  .left {
    width: 220px;
    max-height: 800px;
    overflow: auto;
    @include scrollBar2;

    .el-tree {
      @include scrollBar2;
    }
  }

  .right {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: auto;
    @include scrollBar2;
  }
}

::v-deep .text-tabs {
  .el-tabs__active-bar {
    width: 79px;
  }

  .el-tabs__item {
    font-size: 20px;
    font-weight: 600;
    opacity: 0.8;
  }
}

.btns {
  margin-top: 10px;
  text-align: right;
}
</style>
